package com.jason.filter;

import org.apache.dubbo.common.Constants;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;

@Activate(group = Constants.PROVIDER)
public class TransportIpFilter implements Filter {

    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        System.out.println("消费者的ip:" + RpcContext.getContext().getAttachment("consumerIp"));
        return invoker.invoke(invocation);
    }
}
